﻿// =================================================================== 
// 项目说明
//====================================================================
// 
// 文件： BS_DATASET_SQL.cs
// 项目名称：

// 创建时间：2013/3/19
// 负责人：
// ===================================================================
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using CommonLib.Model;
using CommonLib.IDAL;


namespace MSSQLDAL
{
    /// <summary>
    /// 数据层实例化接口类  .
    /// </summary>
    public partial class BS_DATASET_SQLDAL : IBS_DATASET_SQLDAL
    {
		//此处写查询数据的sql语句，


        //if QueryDataString==""，DAL层的GetList，GetRecordCount等函数将直接存取BS_DATASET_SQL表


        //if QueryDataString!=""，则DAL层的GetList，GetRecordCount等函数将存取该SQL语句，取代表
		//注意：所写sql语句执行结果的字段必须是唯一的


		private const string QueryDataString = "SELECT DATASET_ID,  DEPT_ID,  DATASET_CLASS,  DATASET_NAME,  DATASET_SQL,  HAS_PARAMETER,  ALLOW_MODIFY,  DATASET_MODE,  DATASET_USE,  IS_VISIBLE,"
                                            + " (SELECT A.DEPT_NAME FROM SYS_DEPT A WHERE rtrim(A.DEPT_ID)=BS_DATASET_SQL.DEPT_ID) DEPT_NAME,"
                                            + " (SELECT A.CLASS_NAME FROM BS_DATASET_CLASS A WHERE A.DATASET_CLASS=BS_DATASET_SQL.DATASET_CLASS) DATASET_CLASS_NAME,"
                                            + " (CASE WHEN HAS_PARAMETER=0 THEN '否' WHEN HAS_PARAMETER=1 THEN '是' END) HAS_PARAM_STRING,"
                                            + " (CASE WHEN IS_VISIBLE=0 THEN '否' WHEN IS_VISIBLE=1 THEN '是' END) IS_VISIBLE_STRING,"
                                            + " (case when ALLOW_MODIFY=0 then '否' when ALLOW_MODIFY=1 then '是' end) ALLOW_MODIFY_STRING"
                                            + " FROM BS_DATASET_SQL ";

        public DataTable SqlGetTable(string TransSQL)
        {
            return DBCommon.SqlGetTable(TransSQL);
        }

        public int ExecSqlCommand(string TransSQL)
        {
            return DBCommon.ExecSqlCommand(TransSQL);
        }

   
	}
}

